import {type BrowserWindow, ipcMain} from 'electron'
import {WINDOW_MOVE_EVENT} from '@/utils/event'

export function watchDrag(win: BrowserWindow) {
  ipcMain.on(WINDOW_MOVE_EVENT, (event, args) => {
    if (!args) return
    win.setPosition(args.x, args.y)
  })
}